#include "taskthread.h"

namespace Common {

TaskThread::TaskThread(QObject *parent)
    : QThread(parent)
    , taskState(IdleState)
    , runningFlag(false)
{

}

TaskThread::~TaskThread()
{

}

bool TaskThread::running()
{
    return (taskState == StartState);
}

/**
 * @brief 启动任务
 */
void TaskThread::startTask()
{
    taskState = StartState;
    emit stateChanged(taskState);
}

/**
 * @brief 关闭任务
 */
void TaskThread::stopTask()
{
    taskState = StoppedState;
    emit stateChanged(taskState);
}

}//namespace Common
